Ext.define('Admin.view.system.task.Task', {
    extend: 'Admin.ux.PageGrid',
    xtype: 'task-view',
    title: '任务管理',
    viewModel: {
        stores: {
            data: {
                type: 'task-store',
                autoLoad: true
            }
        },
        data: {
            giveAuthBtnStatus: true
        }
    },
    controller: 'task',

    listeners: {
        selectionchange: 'onSelectionChange'
    },
    columns: [
        {xtype: 'rownumberer', width: 80, text: '行号'},
        {xtype: 'gridcolumnview', text: '名称', dataIndex: 'taskname'},
        {xtype: 'gridcolumnview', text: '内容', dataIndex: 'taskcontent'},
        {type: 'date', text: '开始时间', dataIndex: 'starttime', dateFormat: 'm/d/Y'},
        {type: 'date', text: '结束时间', dataIndex: 'endtime', dateFormat: 'm/d/Y'},
        {
            menuDisabled: true,
            sortable: false,
            xtype: 'actioncolumn',
            width: 60,
            text: '操作',
            items: [
                {
                    iconCls: 'array-grid-buy-col',
                    tooltip: '编辑',
                    handler: 'editAction'
                },
                '-',
                {
                    iconCls: 'array-grid-sell-col',
                    tooltip: '删除',
                    handler: 'removeAction'
                }
            ]
        }
    ],


    tbar: [
        {
            text: '创建任务',
            iconCls: 'x-fa fa-plus',
            handler: 'addAction'
        },

        '->',
        {
            xtype: 'keysearchfield'
        }
    ]
});
